﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="uc_AddDelegate.aspx.cs" Inherits="HFWebApp.user.uc_AddDelegate" %>
<%@ Register src="../Control/top.ascx" tagname="top" tagprefix="uc1" %>
<%@ Register src="../Control/end.ascx" tagname="end" tagprefix="uc2" %>
<%@ Register src="c_LeftMenu.ascx" tagname="c_LeftMenu" tagprefix="uc3" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />
<title>用户管理中心_红法网</title>
<link href="<%=this.getDemain %>/Style/Style.css" rel="stylesheet" type="text/css" />
<link href="<%=this.getDemain %>/Style/CenterStyle.css" rel="stylesheet" type="text/css" />
<link href="<%=this.getDemain %>/CSS.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<%=this.getDemain %>/Scripts/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="<%=this.getDemain %>/javascript/SwitchTags.js"></script>
<script type="text/javascript" src="<%=this.getDemain %>/Scripts/WebFunction.js"></script>
<script type="text/javascript">
    $(function () {
        loadProvince('provinceid', 'cityid');
        loadLegalAffairs('classid');
    });

    function SendDelegate() {
        var endtimeCount = $("#endtimeCount");
        var email = $("#email");
        var cityid = $("#cityid");
        var provinceid = $("#provinceid");
        var phone = $("#phone");
        var delegatepersontype = $("#delegatepersontype");
        var delegatename = $("#delegatename");
        var delegatemoney = $("#delegatemoney");
        var involvedcasemoney = $("#involvedcasemoney");
        var delegateclaim = $("#delegateclaim");
        var delegatecontent = $("#delegatecontent");
        var classid = $("#classid");

        if (classid.val() == "0") {
            alert('请你选择您要委托的案例类型');
            classid.focus();
            return false;
        }

        if (delegatename.val() == "") {
            alert('主题不能为空');
            delegatename.focus();
            return false;
        }

        if (delegatecontent.val() == "") {
            alert('委托内容不能为空');
            delegatecontent.focus();
            return false;
        }

        if (delegateclaim.val() == "") {
            alert('委托要求不能为空');
            delegateclaim.focus();
            return false;
        }

        if (involvedcasemoney.val() == "") {
            alert('委托金额不能为空');
            involvedcasemoney.focus();
            return false;
        }

        if (delegatemoney.val() == "") {
            alert('委托费用不能为空');
            delegatemoney.focus();
            return false;
        }

        if (phone.val() == "") {
            alert('联系电话不能为空');
            phone.focus();
            return false;
        }

        if (provinceid.val() == "") {
            alert('请选择省份');
            provinceid.focus();
            return false;
        }

        if (cityid.val() == "") {
            alert('请选择城市');
            cityid.focus();
            return false;
        }
        $.getJSON(
            "/AjaxSource/AddDelegate.ashx",
            {
                endtimeCount: endtimeCount.val(),
                email: email.val(),
                cityid: cityid.val(),
                provinceid: provinceid.val(),
                phone: phone.val(),
                delegatepersontype: delegatepersontype.val(),
                delegatename: delegatename.val(),
                delegatemoney: delegatemoney.val(),
                involvedcasemoney: involvedcasemoney.val(),
                delegateclaim: delegateclaim.val(),
                delegatecontent: delegatecontent.val(),
                classid: classid.val(),
                rand: Math.floor(Math.random() * 10000).toString()
            },
            function (jsonData) {
                alert(jsonData.Message);
                if (jsonData.isTrue)
                { location = 'uc_DelegateList.aspx'; }
            }
        );

        return false;
    }
</script>
</head>

<body>
<uc1:top ID="top1" MenuClassID="1" focusLink1="focusLink" runat="server" />
<div id="c_BodyBox">
    <div class="c_LeftMenu">
        <uc3:c_LeftMenu ID="c_LeftMenu1" runat="server" />
    </div>
    <div class="c_RightContent">
        <h3>发布案件委托</h3>
        <div class="c_MessageBox">
            <ul>
            <form id="modifyForm" onsubmit="return SendDelegate();">
                <li>
                    <div class="c_MB_Left">案件类型</div>
                    <div class="c_MB_Mid"><select name="classid" id="classid">
                  <option value="0">请选择</option>
                </select></div>
                    <div class="c_MB_Right">*选择属于你的案件的类型</div>
                </li>
                <li>
                    <div class="c_MB_Left">委托主题</div>
                    <div class="c_MB_Mid"><input name="delegatename" type="text" id="delegatename" value="" size="40" /></div>
                    <div class="c_MB_Right"></div>
                </li>
                <li>
                    <div class="c_MB_Left">委托内容</div>
                    <div class="c_MB_Mid_Fix"><textarea name="delegatecontent" id="delegatecontent" cols="40" rows="6"></textarea></div>
                </li>
                <li>
                    <div class="c_MB_Left">委托要求</div>
                    <div class="c_MB_Mid_Fix"><textarea name="delegateclaim" id="delegateclaim" cols="40" rows="6"></textarea></div>
                </li>
                <li>
                    <div class="c_MB_Left">委托金额</div>
                    <div class="c_MB_Mid"><input name="involvedcasemoney" type="text" id="involvedcasemoney" value="0" size="4" />&nbsp;元 (默认为0则显示为保密)</div>
                    <div class="c_MB_Right"></div>
                </li>
                <li>
                    <div class="c_MB_Left">委托费用</div>
                    <div class="c_MB_Mid"><input name="delegatemoney" type="text" id="delegatemoney" value="0" size="4" />&nbsp;元(默认为0则显示为保密)</div>
                    <div class="c_MB_Right"></div>
                </li>
                <li>
                    <div class="c_MB_Left">委托人性质</div>
                    <div class="c_MB_Mid">
                        &nbsp;<input checked="checked" name="delegatepersontype" value="当事人" id="delegatepersontype" type="radio" />当事人&nbsp;
                        &nbsp;<input name="delegatepersontype" value="非当事人" id="delegatepersontype" type="radio" />非当事人&nbsp;
                        &nbsp;<input name="delegatepersontype" value="律师" id="delegatepersontype" type="radio" />律师&nbsp;
                        &nbsp;<input name="delegatepersontype" value="律所" id="delegatepersontype" type="radio" />律所</div>
                    <div class="c_MB_Right"></div>
                </li>
                <li>
                    <div class="c_MB_Left">联系电话</div>
                    <div class="c_MB_Mid"><input name="phone" type="text" id="phone" value="" size="40" /></div>
                    <div class="c_MB_Right"></div>
                </li>
                <li>
                    <div class="c_MB_Left">委托所在地</div>
                    <div class="c_MB_Mid"><select name="provinceid" id="provinceid">
                  <option value="0">请选择</option>
                </select>
                  <select name="cityid" id="cityid">
                    <option value="0">请选择</option>
                </select></div>
                    <div class="c_MB_Right"></div>
                </li>
                <li>
                    <div class="c_MB_Left">电子邮件</div>
                    <div class="c_MB_Mid"><input name="email" type="text" id="email" value="" size="40" /></div>
                    <div class="c_MB_Right"></div>
                </li>
                <li>
                    <div class="c_MB_Left">有效期</div>
                    <div class="c_MB_Mid_Fix">&nbsp;<input name="endtimeCount" value="3" id="endtimeCount" type="radio" />三天&nbsp;
                        &nbsp;<input name="endtimeCount" value="7" id="endtimeCount"type="radio" />一周&nbsp;
                        &nbsp;<input  checked="checked" name="endtimeCount" value="15" id="endtimeCount" type="radio" />十五天&nbsp;
                        &nbsp;<input name="endtimeCount" value="30" id="endtimeCount"type="radio" />一个月&nbsp;
                        &nbsp;<input name="endtimeCount" value="61" id="endtimeCount"type="radio" />两个月&nbsp;
                        &nbsp;<input name="endtimeCount" value="184" id="endtimeCount"type="radio" />半年&nbsp;</div>
                </li>
                <li>
                    <div class="c_MB_Left"></div>
                    <div class="c_MB_Mid"><input id="Button1" type="submit" value="保存" /></div>
                    <div class="c_MB_Right"></div>
                </li>
            </form>
            </ul>
        </div>
    </div>
</div>
<uc2:end ID="end1" runat="server" />
</body>
</html>